package com.fuint.common.enums;

/**
 * 卡券适用商品
 *
 * @author Tom
 * 
 */
public enum PayChannelEnum {
    STORE("1", "店铺"),
    PLATFORM("2", "平台");

    private String key;

    private String value;

    PayChannelEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    // 普通方法，通过key获取value
    public static String getValue(String k) {
        for (PayChannelEnum c : PayChannelEnum.values()) {
            if (c.getKey().equals(k)) {
                return c.getValue();
            }
        }
        return null;
    }

    // 普通方法，通过Value获取key
    public static String getKey(String v) {
        for (PayChannelEnum c : PayChannelEnum.values()) {
            if (c.getValue() == v) {
                return c.getKey();
            }
        }
        return null;
    }
}
